import { Link } from "react-router-dom";


export default function Error(props) {


    const goLogin = () => {
        props.history.push("/login")
    }

    const goNewsDetail = () => {
        props.history.push({
            pathname:'/newsDetail/1',
            query:{
                id:123
            }
        })
    }

    return (
        <div className="error">
            <p>404</p>
            <Link to="/">跳转首页</Link>
            <p onClick={goLogin}>跳转登录</p>
            <p onClick={goNewsDetail}>跳转新闻详情</p>
        </div>
    )
}